package com.fengyi.library.service;

import com.fengyi.library.DTO.BookDTO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

public interface BookService {
    BookDTO findById(Integer id);
    BookDTO findByIsbn(String isbn);
    List<BookDTO> findAllBooks();
    Page<BookDTO> findAllBooks(Pageable pageable);
    Page<BookDTO> findBooksByTitle(String title, Pageable pageable);
    Page<BookDTO> findBooksByAuthor(String author, Pageable pageable);
    Page<BookDTO> findBooksByCategory(String category, Pageable pageable);
    Page<BookDTO> searchBooks(String keyword, Pageable pageable);
    List<BookDTO> findAvailableBooks();
    BookDTO saveBook(BookDTO bookDTO);
    void deleteBook(Integer id);
    boolean isBookAvailable(Integer id);
    void updateBookQuantity(Integer id, int quantityChange);
    long countBooks();
}
